package com.itheima.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.feedback.FeedbackDao;
import com.itheima.domain.feedback.Feedback;
import com.itheima.domain.feedback.FeedbackExample;
import com.itheima.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;
@Service
public class FeesbackServiceImpl implements FeedbackService {
    @Autowired
    private FeedbackDao feedbackDao;

//保存留言
    @Override
    public void save(Feedback feedback) {
        feedbackDao.insert(feedback);
    }
//修改信息
    @Override
    public void update(Feedback feedback) {
        //执行修改
    feedbackDao.updateByPrimaryKeySelective(feedback);

    }

    @Override
    public void delete(String id) {

    }

    @Override
    public Feedback findById(String id) {
        return feedbackDao.selectByPrimaryKey(id);
    }
    //查询所有反馈
    @Override
    public List<Feedback> findAll(FeedbackExample example) {
        return feedbackDao.selectByExample(example);
    }
}
